// 引入jQuery的CDN
import 'https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js';
class Datail {
    constructor() {

    }

    init() {
        this.xingqy();
    }

    xingqy() {

        let sid = location.search.substring(1).split('=')[1]
        if (!sid) {
            sid = 1;
        }

        // console.log(sid);
        // http://localhost/gome.com.cn/backend/php/detail.php


        $.ajax({
            url: 'http://localhost/WWW.GOME.COM.CN/zkl/interface/php/detail.php',
            data: {
                sid: sid
            },
            dataType: 'json'
        }).then(function(res) {
            console.log(res);
            $('.center-left img ').attr('src', res.url);
            $('.bottom .center-right>div:nth-child(1)>span:nth-child(1)').html(res.title);
            $('.bottom .center-right .qian div:nth-child(1)>span:nth-child(2)').html(res.price);
            let arr = res.piclist.split(',');
            console.log(arr);

        })

    }

}
export {
    Datail
}